<?php
class ORMStatus extends ORMBase {
  public function __construct() {
    parent::__construct('Status');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->state = isset($object->state) ? $object->state : 0;
    $epObject->date = isset($object->date) ? SimpleDate::toStamp($object->date) : 0;
    $epObject->model = isset($object->model) ? $object->model : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->state = $epObject->state;
    $object->date = SimpleDate::fromStamp($epObject->date);
    $object->model = $epObject->model;
    return $object;
  }
}
?>
